#导入创建app的方法
from app import create_app
#导入装饰器方法
from conf.comm import sqlalchemy_context
from database import *
from views.users import bp_users
from flask_cors import CORS
#获取app
app = create_app()

#跨域
CORS(app)
#注册蓝图
app.register_blueprint(bp_users,url_prefix='/users')

#创建表
@app.route('/add')
@sqlalchemy_context()
def create_table():
    # db.drop_all()
    db.create_all()

if __name__ == "__main__":
    app.run()